home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F26524_Test1.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-09-28  |  1.1 KB  |  26 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
  4. <!-- Run this stylesheet against Test.xml -->
  5. <!-- The output from this stylesheet may seem unexpected   -->
  6. <!-- as there is text in it that was not specifically      -->
  7. <!-- requested.                                            -->
  8. <!-- This is because the XSLT built-in rules have also     -->
  9. <!-- been applied to all A elements.  To show that the     -->
  10. <!-- built-in rules are being applied - ensure that you    -->
  11. <!-- have the 'Include (debug) XSLT built-in rules'        -->
  12. <!-- option turned on (Environment Options - Debugger tab) -->
  13. <!-- and run a debug on this stylesheet.                   -->
  14. <xsl:template match="/">
  15.   <root>
  16.     <xsl:apply-templates select="root/A"/>
  17.   </root>
  18. </xsl:template>
  19.  
  20. <!-- only select A elements that have a child B element  -->
  21. <!-- where the B element text contains the word 'SHOULD' -->
  22. <xsl:template match="A[B[contains(text(),'SHOULD')]]">
  23.   <xsl:copy-of select="."/>
  24. </xsl:template>
  25. </xsl:stylesheet>
  26.